package com.suray.type;

public enum RgvSonTaskResult {
    INVALID(-1, "无效"),
    INIT(0, "初始"),
    FAIL(1, "失败"),
    SUCCESS(2, "成功"),
    ;

    int value;
    String des;
    RgvSonTaskResult(int value, String des) {
        this.value = value;
        this.des = des;
    }

    public static RgvSonTaskResult parseValue(int value) {
        for (RgvSonTaskResult rgvSonTaskResult : RgvSonTaskResult.values()) {
            if (rgvSonTaskResult.value == value) {
                return rgvSonTaskResult;
            }
        }

        return INVALID;
    }

    @Override
    public String toString() {
        return des;
    }
}
